{% extends 'base.html' %}
{% block seo %}
    <title>{% if isreaded %}（新消息）{% endif %}发布信息 - 商品市场 - {{ web_config.title }}</title>
    <meta name="keywords" content="商品市场,商品交易,虚拟商品">
    <meta name="description" content="市肥宅中心商品市场交易中心">
{% endblock %}
{% block content %}
    <div class="section-header">
        <div class="section-header-left">
            <h3>
                <font style="vertical-align: inherit;">
                    <font style="vertical-align: inherit;">发布翻新需求 </font>
                </font>
            </h3>
        </div>
    </div>
    <form class="uk-form-stacked" action="/pbmarket/" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {% if error %}
            <div class="uk-alert-danger" uk-alert>
                <a class="uk-alert-close" uk-close></a>
                <p>{{ error }}</p>
            </div>
        {% endif %}
        {#    商品分类(不可修改)#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-select">商品分类<span style="color: red">*</span></label>
            <div class="uk-form-controls">
                <select class="uk-select" id="form-stacked-select" name="mkcatgr">
                    {% for item in mtypes %}
                        {% if curnav == item.id %}
                            <option value="{{ item.id }}" selected="selected">{{ item.typename }}</option>
                        {% endif %}
                    {% endfor %}
                </select>
            </div>
        </div>
        {#    商品标题#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">商品标题<span style="color: red">*</span></label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="mktitle" type="text"
                       placeholder="请输入尽量简短的商品标题" required>
            </div>
        </div>
        {#    商品价格#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">翻新预算<span style="color: red">*</span></label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="mkprice" type="number"
                       placeholder="请输入翻新预算" min="0" required>
            </div>
        </div>
        {#    house_master_name 房屋主人名字#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">房屋主人名字 <span style="color: red">*</span></label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="house_master_name" type="text"
                       placeholder="房屋主人名字" required>
            </div>
        </div>
        {#    隐藏内容#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">联系方式<span style="color: red">*</span></label>
            <textarea class="uk-textarea" name="mkhiden" rows="5" placeholder="填写你的联系方式，用户支付肥宅币后才会显示，不会对你产生打扰"
                      required></textarea>
        </div>

        {#    选择封面#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">选择封面</label>
            <input type="file" name="mkphoto" accept="image/jpeg,image/png">
        </div>
        {#    商品描述#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">商品描述</label>
            <textarea class="uk-textarea" name="mkdescp" rows="5" placeholder="请输入尽量详细的商品描述（支持markdown）"></textarea>
        </div>
        {#    联系的时间段#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-select">可联系的时间段</label>
            <div class="uk-form-controls">
                <select class="uk-select" id="form-stacked-select" name="mketchat_time">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                </select>
            </div>
        </div>

        {#    house_dizhi 房屋地址#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">房屋地址</label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="house_dizhi" type="text"
                       placeholder="请输入房屋地址">
            </div>
        </div>
        {#    house_louceng 房屋楼层#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">房屋楼层</label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="house_louceng" type="number"
                       placeholder="请输入房屋楼层" min="0">
            </div>
        </div>
        {#    house_mianji 房屋面积#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-text">房屋面积</label>
            <div class="uk-form-controls">
                <input class="uk-input" id="form-stacked-text" name="house_mianji" type="number"
                       placeholder="请输入房屋面积">
            </div>
        </div>
        {#    house_leixing 房屋类型#}
        <div class="uk-margin">
            <label class="uk-form-label" for="form-stacked-select">房屋类型</label>
            <div class="uk-form-controls">
                <select class="uk-select" id="form-stacked-select" name="house_leixing">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                </select>
            </div>
        </div>




        {% if user %}
            <button class="uk-button uk-button-primary" type="submit">发布商品</button>
        {% else %}
            <button class="uk-button uk-button-primary" type="submit" disabled>未登录</button>
        {% endif %}
    </form>
{% endblock %}